package comtwo;

import comone.javatwo.User;

import java.util.*;

public class Demo6 {
    public static void main(String[] args) {
        Map map = new HashMap();
        //增
        map.put("user",new User());
        map.put("name","张三");
        //取值
        Object o = map.get("user");
        //System.out.println(o.toString());
        /*for (int i = 0; i <map.size() ; i++) {
            map.get(i);
        }*/
        //获取map中所有的value
        /*Collection values = map.values();
        for (Object object:values) {
            System.out.println(object.toString());
        }*/
        /*Set set = map.keySet();
        for (Object object:set) {
            System.out.println(object.toString());
        }*/
        //修改
        //map.put("name","lisi");
        //map.replace("name","lisi");
        //map.replace("name","张三ffff","dddddd");

        //删除
        //Object remove = map.remove("name");
        //map.remove("name","张rr三");
        Collection values = map.values();
        for (Object object:values) {
            System.out.println(object.toString());
        }
    }
}
